<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initNavigation()
    {
        
        
        $xml = APPLICATION_PATH . '/configs/navigation.xml';
        $pages = new Zend_Config_Xml($xml);
        $navigation = new Zend_Navigation($pages);
        
        $view = $this->_getView();
        $storage = Zend_Auth::getInstance()->getStorage()->read();
        $role = (isset ($storage->user_role) ) ?  $storage->user_role : 'guest';
        $view->navigation($navigation)->setAcl(new Ahs_Acl())->setRole($role);
        
        
    }
    
    protected function _initJQueryViewHelper()
    {
        $view = $this->_getView();
        $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
        $view->jQuery()->setVersion('1.7')       // standaard 1.3.2
                       ->setUiVersion('1.8.16'); // standaard 1.7.1
    }
    protected function _initViewHelpers()
    {

        $view = $this->_getView();
        $view->doctype('HTML5'); // http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.doctype
        $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
        $view->headTitle('ZendDemo')->setSeparator(' - ');
    }
    
    protected function _getView()
    {
        $this->bootstrap('layout');
        $layout = $this->getResource('layout');

        $view = $layout->getView();
        
        return $view;
    }
     
     

}

